import random

setGlobalDuration(6)

env = genAdsr(release = .7)

sclMidi = scale('C', 'midi')
sclHertz = scale('C', 'hertz')

# MIDI
for i in range(16):
    soundfont(midipitch = sclMidi[random.randint(24,48)], starttime = i * .25, duration = 2)
    waveform(pitch = sclHertz[random.randint(24,48)], starttime = i * .25, duration = 2, 
             amplitude = .1, envelope = env)

startCsound()